/**
 * Copyright (c) Tiny Technologies, Inc. All rights reserved.
 * Licensed under the LGPL or a commercial license.
 * For LGPL see License.txt in the project root for license information.
 * For commercial licenses see https://www.tiny.cloud/
 *
 * Version: 5.2.2 (2020-04-23)
 */
import store from '@/store'
var global = tinymce.util.Tools.resolve('tinymce.PluginManager')
var register = function(editor) {
  editor.addCommand('mceHistory', function() {
    console.log(store)
    store.commit('index/set_historyDialogVisible', true)
  })
}
var Commands = { register: register }

var register$1 = function(editor) {
  editor.ui.registry.getAll().icons.history || editor.ui.registry.addIcon('history', '<svg t="1593246462017" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2125" width="24" height="24"><path d="M511.163 32.070c-264.364 0-478.677 214.314-478.677 478.684 0 264.364 214.314 478.677 478.677 478.677 264.37 0 478.684-214.314 478.684-478.677 0-264.37-214.314-478.684-478.684-478.684zM748.823 748.407c-5.488 5.488-12.681 8.233-19.867 8.233-7.193 0-14.385-2.745-19.872-8.233l-226.013-226.019v-285.831c0-15.529 12.59-28.105 28.098-28.105 15.515 0 28.105 12.577 28.105 28.105v262.562l209.549 209.549c10.975 10.963 10.975 28.769 0 39.74z" p-id="2126"></path></svg>')

  editor.ui.registry.addButton('history', {
    // icon: 'history',
    icon: 'history',
    tooltip: '历史版本',
    onAction: function() {
      return editor.execCommand('mceHistory')
    }
  })
  editor.ui.registry.addMenuItem('history', {
    icon: 'history',
    text: '历史版本',
    onAction: function() {
      return editor.execCommand('mceHistory')
    }
  })
}
var Buttons = { register: register$1 }

function Plugin() {
  global.add('history', function(editor) {
    Commands.register(editor)
    Buttons.register(editor)
  })
}

Plugin()
